﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;

namespace VisualRibbonEditor
{
	public class OrgRequest
	{
		private string _reqName;

		public Dictionary<string, object> Parameters = new Dictionary<string, object>();

		public OrgRequest(string requestName)
		{
			this._reqName = requestName;
		}

		public OrganizationRequest ToOrganizationRequest()
		{
			OrganizationRequest req = new OrganizationRequest(_reqName);
			req.Parameters = new ParameterCollection();
				
			foreach( var p in Parameters )
			{
				req.Parameters.Add(p.Key, p.Value);
			}

			return req;
		}

	}
}
